package lab01;

import java.util.Scanner;

public class Test11 {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        for(int i = 0;i <= 100;i ++){
        System.out.println("请输入一个在1~9999之间的成绩：");
            i = s.nextInt();
        if(i/10000 % 10 == 0&i/1000 % 10 == 0
                & i/100 % 10 == 0& i/10 %10 == 0) {
            System.out.println("该数字是一位数");
            System.out.println("不是回文数");
        }
        else if(i/10000 % 10 == 0
                & i/1000 % 10 == 0& i/100 % 10 == 0){
            System.out.println("该数字是两位数");
            if(i/10 %10 == i % 10){
                System.out.println("是回文数");
            }else System.out.println("不是回文数");
        }
        else if (i/10000 % 10 == 0&i/1000 % 10 == 0){
            System.out.println("该数字是三位数");
            if(i/100 % 10 == i % 10){
                System.out.println("是回文数");
            }else System.out.println("不是回文数");
        }
        else if(i/10000 % 10 == 0){
            System.out.println("该数字是四位数");
            if(i/1000 % 10 == i %10
                    &&i/100 % 10 == i/10 % 10){
                System.out.println("是回文数");
            }else System.out.println("不是回文数");
        }
        else {System.out.println("超出范围");break;}
    }
    }
}
